<!--#include virtual="/dzps/p1.asp"-->
<%
myini
Function myini
	rdict_name1 "xxts","选项提示"
	rdict_name1 "sitecontent","网站内容"
	rdict_name1 "canexname","可上传扩展名"
End Function
%>
<!DOCTYPE html>
<html>
<head>
  <title>网站设置</title>
<%
	easp.include "h.asp"
%>  
</head>
<body>
  <div class="layui-fluid">
        <div class="layui-card">
          <div class="layui-card-header">系统设置</div>
          <div class="layui-card-body" pad15>
            <div class="layui-form" wid100 lay-filter="">
<%
	echo js2("input1.html","webtitle","网站标题",val("webtitle"),"required")
	echo js2("input1.html","website","网站名称",val("website"),"required")
	echo js2("input1.html","xxts","选项提示",val("xxts"),"required")
	echo js2("textarea.html","canexname","可上传扩展名",val("canexname"),"")
	echo js2("textarea.html","sitecontent","网站内容",val("sitecontent"),"")
%>   
              <div class="layui-form-item">
                <div class="layui-input-block">
                  <button class="layui-btn" lay-submit lay-filter="set_website">确认保存</button>
                  <button class="layui-btn layui-btn-disabled layui-btn-danger"  lay-submit lay-filter="del_website"> 删除所有数据</button>
                </div>
              </div>
            </div>
        </div>
      </div>
  </div>
  <script src="/dzps/src/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/dzps/src/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'set','layedit'],function(){
    var $ = layui.$
    ,admin = layui.admin
    ,form = layui.form;  
	var layedit = layui.layedit;
	layedit.set({
  uploadImage: {
    url: '/dzps/upload2.asp' //接口url
    ,type: 'post' //默认post
  }
});
    var index= layedit.build('sitecontent'); //建立编辑器
      form.on('submit(set_website)', function(data){
      var field = data.field;
      //alert($('#webtitle').val());
	  admin.req({
        url: layui.setter.base + 'lib/reg.asp?action=website' 
        ,type:"post"
		,data: {xxts:$('#xxts').val(),canexname:$('#canexname').val(), sitename:$('#website').val(),webtitle:$('#webtitle').val(),sitecontent:layedit.getContent(index)}
        ,done: function(res){
			if(res.msg=='成功'){
				layer.msg(res.msg, {offset: '15px',icon: 1,time: 1000}, function(){
			  });	
			}else{
				layer.msg(res.msg, {offset: '15px',icon: 1,time: 1000}, function(){}, function(){
			  });			
			}
        }
      });      
    });
	form.on('submit(del_ website)',function(data){
		layer.confirm('您确定删除所有数据？' , {icon: 3,title: '提示信息'},
		function(index) {
			$.post(layui.setter.base + 'lib/reg.asp?now=' + new Date().getTime(), {
				action: "superdel"
			},
			function(data) {
				if (data == '1') {layer.msg("成功!!");
				} else {
					layer.msg("失败！！ "+data);
				}
			});
			layer.close(index);
		});		
	});
  });
  </script>
</body>
</html>